
$(document).ready(
	function()
	{
		var myPDF = null;
		var obj=$("#EMHOLEPAGEVIEW").find("p[EMHTYPE='URL']");
		if((obj!=null)&&(obj.length>0))
			myPDF = new PDFObject({url: obj.text()});

		var obj=$("#EMHOLEPAGEVIEW").find("p[EMHTYPE='XML']");
		if((obj!=null)&&(obj.length>0))
		{
			var xmlobj=$(obj.text());
			if((xmlobj!=null)&&(xmlobj.length>0))
			{
				if(xmlobj.children("URL").length>0)
				{
					var lpurl=$.emhpostobject.PassHttpUrl(xmlobj.children("URL").text());
					if((lpurl!=null)&&(lpurl.length>0))
					{
						xmlobj.find("PARA").each
						(
							function(index, ele)
							{
								if(lpurl.indexOf("?")>0)
									lpurl+=("&"+$(ele).find("NAME").text()+"="+encodeURIComponent($(ele).find("TEXT").text()));
								else
									lpurl+=("?"+$(ele).find("NAME").text()+"="+encodeURIComponent($(ele).find("TEXT").text()));
							});
					}
					myPDF = new PDFObject({url: lpurl});
				}
			}
		}
		if(myPDF!=null)
			myPDF.embed("EMHOLEPAGEVIEW");
	}
);
